<template>
  <t-image-viewer v-if="!store.isMobileType" v-model:visible="ImgVisible" :images="[urls + props.info.value]">
  </t-image-viewer>
  <van-image-preview :show-index="false" v-else v-model:show="ImgVisible" :images="[urls + props.info.value]">
  </van-image-preview>
  <div class="outline-parent jy-style-height">
    <div class="border-hover-style" style="display: flex">
      <div
        class="content-parent"
        :style="{
          backgroundImage: `url(${publicUrls + 'free/style10/Level2outlineStyle3Bg.webp'})`,
        }"
      >
        <div class="digitalShowroom-p" v-if="props.info.digitalShowroom">
          <digitalShowroomIcon :url="props.info.digitalShowroom" />
        </div>
        <div
          v-if="!props.info.value && !props.info.remarks"
          class="content2"
          :class="{
            content3: !props.info.subTitle,
          }"
        >
          <div
            v-html="textType(props.info.text)"
            :style="{
              backgroundImage: `url(${publicUrls + 'free/style10/Level2outlineStyle3titleBg.webp'})`,
            }"
            class="title-box"
          ></div>
          <p class="subtitle" v-if="props.info.subTitle">{{ props.info.subTitle }}</p>
        </div>
        <div v-else class="content">
          <div
            v-html="textType(props.info.text)"
            :style="{
              backgroundImage: `url(${publicUrls + 'free/style10/Level2outlineStyle3titleBg.webp'})`,
            }"
            class="title-box"
          ></div>
          <div class="content-right">
            <p class="subtitle" v-if="props.info.subTitle">{{ props.info.subTitle }}</p>
            <div
              class="img-box"
              :class="{
                'img-box1': props.info.remarks && !props.info.subTitle,
                'img-box2': !props.info.remarks && props.info.subTitle,
                'img-box3': !props.info.remarks && !props.info.subTitle,
              }"
              v-if="props.info.value"
            >
              <div class="outline-cover">
                <img @click="ImgVisible = true" :src="urls + props.info.value + '?imageView2/3/format/webp'" alt="" />
              </div>
            </div>
            <div class="remarks1" v-if="props.info.value">
              <TextMax
                :infoData="props.info"
                v-if="props.domShow"
                :data="props.info.remarks"
                :title="props.info.text"
                :row="5"
              ></TextMax>
            </div>
            <div
              class="remarks2"
              :class="{
                remarks3: !props.info.subTitle,
              }"
              v-else-if="props.info.remarks"
            >
              <TextMax
                :infoData="props.info"
                v-if="props.domShow"
                :data="props.info.remarks"
                :title="props.info.text"
                :row="props.info.subTitle ? 13 : 13"
              ></TextMax>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>  

<script lang="ts">
export default defineComponent({
  name: 'free5Style4',
});
</script>

<script setup lang="ts">
import { getRemarksNum } from '@/utils/minxin';
import digitalShowroomIcon from '@/freeComponents/unitdigitalShowroom/style10.vue';
import { publicUrls } from '@/utils/minxin';
import { getTextHtml, textType } from '@/utils/minxin';
import { urls } from '@/utils/request/upload';
import { computed, defineComponent, ref } from 'vue';
import TextMax from '@/freeComponents/textMode/textMax10.vue';
import { useProjectStore } from '@/store';
import { useRouter, useRoute } from 'vue-router';
const route = useRoute();
const ImgVisible = ref(false);
const store = useProjectStore();
const title = ref();

const props = defineProps({
  info: {
    type: Object,
  },
  domShow: {
    type: Boolean,
  },
});
</script>

<style scoped lang="less">
.outline-parent {
  display: flex;
  align-items: flex-end;
  position: relative;
  margin-right: 140px;
  margin-left: 80px;
  margin-top: 0;
  height: 100%;
}
.content-parent {
  display: flex;
  position: relative;
  width: 758px;
  height: 774px;
  background-size: 100% 100%;
  background-repeat: no-repeat;
}
.digitalShowroom-p {
  position: absolute;
  top: 195.5px;
  left: 116px;
  width: 51px;
  height: 89px;
  z-index: 15;
}
.content {
  position: relative;
  display: flex;
  width: 758px;
  padding: 102px 105px 103px 241px;
  .title-box {
    margin-top: 20px;
    margin-left: 20px;
  }
}
.content-right {
  width: 291px;
  margin-top: 20px;
  margin-left: 10px;
  .subtitle {
    width: 291px;
  }
}
.content2 {
  position: relative;
  display: flex;
  flex-direction: column;

  width: 758px;
  padding: 102px 105px 103px 241px;
  .title-box {
    margin-left: 130px;
    margin-top: 63px;
  }
  .subtitle {
    width: 291px;
    margin-top: 20px;
    margin-left: 20px;
  }
}
.content3 {
  .title-box {
    margin-left: 130px;
    margin-top: 118px;
  }
}
.title-box {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 70px;
  height: 343px;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  :deep(p) {
    width: 22px;
    max-height: 208px;
    font-family: SJxingkai-C;
    font-size: 24px;
    color: rgba(57, 56, 54, 1);
    line-height: 26px;
  }
  :deep(p:nth-child(2)) {
    margin-left: 6px;
  }
}

.subtitle {
  font-family: PingFang SC;
  font-size: 18px;
  color: rgba(57, 56, 54, 1);
  line-height: 28px;
  text-align: left;
}

.img-box {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  width: 211px;
  height: 259px;
  background: rgba(57, 56, 54, 0.1);
  .outline-cover {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 211px;
    height: calc(100% - 10px);
    overflow: hidden;
    img {
      transition: all 0.3s;
      width: 211px;
      max-height: 100%;
      height: auto;
      object-fit: contain;
    }
  }
}
.img-box:hover {
  .outline-cover {
    img {
      transform: scale(1.2);
    }
  }
}
.img-box1 {
  height: 325px;
  margin-top: 0px;
}
.img-box2 {
  height: 401px;
  margin-top: 10px;
}
.img-box3 {
  height: 401px;
  margin-top: 66px;
}

.remarks1 {
  width: 212px;
  margin-top: 10px;
  :deep(.van-text-ellipsis) {
  }
}
.remarks2 {
  width: 212px;
  margin-top: 20px;
}
.remarks3 {
  width: 212px;
  margin-top: 68px;
}
</style>